
Page({
    data: {
        totalCount: 0
    },
    gotoDetail() {
        wx.navigateTo({
            url: "/pages/detail/detail",
        })
    },
    addCount() {
        let res = this.data.totalCount
        res++
        if (res > 5) {
            wx.showToast({
                icon: 'none',
                title: '卖没了傻der',
            })
            return
        }
        this.setData({
            totalCount: res
        })
    },
    subCount() {
        let ress = this.data.totalCount
        ress--
        if (ress < 0) {
            wx.showToast({
                icon: 'none',
                title: '再减让你飞起来熬',
            })
            return
        }
        this.setData({
            totalCount: ress
        })
    }
})